package bysj.service;

import bysj.dao.FileDao;
import bysj.domain.File;
import util.JdbcHelper;

import java.sql.Connection;
import java.sql.SQLException;

public class FileService {
    private static FileDao fileDao = FileDao.getInstance();
    private static FileService fileService =new FileService();
    private FileService(){}

    public static FileService getInstance(){
        return fileService;
    }
    public int addFile(File file) throws SQLException {
        Connection connection = JdbcHelper.getConn();
        int file_add=fileDao.add(file,connection);
        JdbcHelper.close(connection);
        return  file_add;
    }
}
